home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / dosutils / tsbat50.zip / SCANZ.BAT < prev    next >
DOS Batch File  |  1996-04-27  |  6KB  |  198 lines

  1. @echo off
  2. echo.
  3. echo ┌───────────────────────────────────────────────────────────┐
  4. echo │ Scan a zip file for viruses including execompressed files │
  5. echo │ By Prof. Timo Salmi, ts@uwasa.fi, Sat 27-April-1996       │
  6. echo └───────────────────────────────────────────────────────────┘
  7. echo.
  8.  
  9. rem To reset screen colors. Adjust or omit as appropriate for you.
  10. set color_=
  11.  
  12. rem If no parameters then give the instructions
  13. if "%1"=="" goto _help
  14.  
  15. rem First check that the zip file(s) exists
  16. if exist %1 goto _next1
  17. echo File %1 not found
  18. goto _out
  19.  
  20. rem If you are sure you have this batch configured correctly
  21. rem uncomment the next line
  22. rem goto _next41
  23.  
  24. :_next1
  25. rem Check that you have the drive r: available (I have r: as ramdisk)
  26. if exist r:\nul goto _next2
  27. echo Working drive R: not found
  28. echo Adjust your configuration, or the %0 batch
  29. goto _out
  30.  
  31. :_next2
  32. rem Check that the virus programs are available
  33. rem First adjust the paths as befits your own system
  34. if exist  d:\virus\mcafee\scan.exe goto _next3
  35. echo File d:\virus\mcafee\scan.exe not found
  36. goto _out
  37. :_next3
  38. if exist  d:\virus\f-prot.exe goto _next4
  39. echo File d:\virus\f-fchk.exe not found
  40. goto _out
  41. :_next4
  42. if exist  d:\virus\tbav\tbscan.exe goto _next5
  43. echo File d:\virus\tbav\tbscan.exe not found
  44. goto _out
  45. :_next5
  46. if exist  d:\virus\im\im.exe goto _next11
  47. echo File d:\virus\im\im.exe not found
  48. goto _out
  49.  
  50. :_next11
  51. rem Check that pkunzip.exe is available
  52. set found_=
  53. for %%d in (%path%) do if exist %%d\pkunzip.exe set found_=yes
  54. for %%d in (%path%) do if exist %%dpkunzip.exe set found_=yes
  55. if "%found_%"=="yes" goto _next21
  56. echo pkunzip.exe must be at path
  57. goto _out
  58.  
  59. :_next21
  60. rem Check that all the exeuncompressors are available
  61. if exist  c:\box\boxtools\dislite.exe goto _next22
  62. echo File c:\box\boxtools\dislite.exe not found
  63. goto _out
  64. :_next22
  65. if  exist c:\box\boxtools\unlzexe.exe goto _next23
  66. echo File c:\box\boxtools\unlzexe.exe not found
  67. goto _out
  68. :_next23
  69. if exist  c:\box\boxtools\diet.exe goto _next24
  70. echo File c:\box\boxtools\diet.exe not found
  71. goto _out
  72. :_next24
  73. if exist  f:\progs\box\unp.exe goto _next31
  74. echo File f:\progs\box\unp.exe not found
  75. goto _out
  76.  
  77. :_next31
  78. rem Check that Timo's ask.exe facility is available
  79. set found_=
  80. if exist ask.exe set found_=yes
  81. for %%d in (%path%) do if exist %%d\ask.exe set found_=yes
  82. for %%d in (%path%) do if exist %%dask.exe set found_=yes
  83. if "%found_%"=="yes" goto _next41
  84. echo Timo's ask.exe must be at path or current directory
  85. goto _out
  86.  
  87. :_next41
  88. rem Make a temporary directory and ensure that it is empty
  89. if not exist r:\tmp$$$\nul mkdir r:\tmp$$$
  90. if exist r:\tmp$$$\*.* echo Deleting all old files from r:\TMP$$$ directory
  91. if exist r:\tmp$$$\*.* del r:\tmp$$$\*.*
  92.  
  93. rem Unzip all .exe, .com, overlay-files and embedded zips from the zipfile
  94. pkunzip %1 *.exe *.com *.ov* *.zip r:\tmp$$$
  95. if exist r:\tmp$$$\*.zip pkunzip r:\tmp$$$\*.zip *.exe *.com *.ov* r:\tmp$$$
  96. if exist r:\tmp$$$\*.zip del r:\tmp$$$\*.zip
  97.  
  98. rem Check for nasties with McAfee scan, first pass
  99. echo %color_%
  100. if exist r:\tmp$$$\*.* d:\virus\mcafee\scan r:\tmp$$$\*.* /nomem
  101.  
  102. rem Check for nasties with tbscan, first pass
  103. :_ask_tb
  104. ask Perform tbscan virus check (y/n)? /d /u
  105. if errorlevel==89 if not errorlevel==90 goto _do_tb
  106. if errorlevel==78 if not errorlevel==79 goto _ask_im
  107. goto _ask_tb
  108. :_do_tb
  109. if exist r:\tmp$$$\*.* d:\virus\tbav\tbscan r:\tmp$$$\*.* nm nb
  110. echo %color_%
  111.  
  112. rem Check for nasties with Integrity master
  113. :_ask_im
  114. ask Perform Integrity Master virus check (y/n)? /d /u
  115. if errorlevel==89 if not errorlevel==90 goto _do_im
  116. if errorlevel==78 if not errorlevel==79 goto _do_fprot
  117. goto _ask_im
  118. :_do_im
  119. if not exist r:\tmp$$$\*.* goto _do_fprot
  120. d:\virus\im\IM /Pr:\tmp$$$ /VR /NOB /b /RF=nul
  121. IF ERRORLEVEL 64 GOTO VIRUS
  122. IF NOT ERRORLEVEL 24 GOTO DONE
  123. ECHO IM found a possible problem
  124. GOTO DONE
  125. :VIRUS
  126. ECHO IM found signs of a virus
  127. :DONE
  128.  
  129. rem Check for nasties with f-prot, first pass
  130. :_do_fprot
  131. echo %color_%
  132. if exist r:\tmp$$$\*.* d:\virus\f-prot r:\tmp$$$\*.* /nomem
  133. pause
  134. if exist r:\tmp$$$\*.* d:\virus\f-prot r:\tmp$$$\*.* /nomem /analyse
  135. :_ask_fprot
  136. echo.
  137. ask Next second pass, with expansion, continue (y/n)? /d /u
  138. if errorlevel==89 if not errorlevel==90 goto _expand
  139. if errorlevel==78 if not errorlevel==79 goto _rmdir
  140. goto _ask_fprot
  141.  
  142. :_expand
  143. rem Expand execompressed files
  144. for %%f in (r:\tmp$$$\*.exe r:\tmp$$$\*.com) do f:\progs\box\unp %%f
  145. pause
  146. rem for %%f in (r:\tmp$$$\*.exe r:\tmp$$$\*.com) do c:\box\boxtools\dislite %%f
  147. rem for %%f in (r:\tmp$$$\*.exe r:\tmp$$$\*.com) do c:\box\boxtools\diet -ra %%f
  148. rem for %%f in (r:\tmp$$$\*.exe) do c:\box\boxtools\unlzexe %%f
  149. rem pause
  150. if exist r:\tmp$$$\*.olz del r:\tmp$$$\*.olz
  151.  
  152. rem Check for nasties, second pass
  153. if exist r:\tmp$$$\*.* d:\virus\tbav\tbscan r:\tmp$$$\*.* nm nb
  154. pause
  155. if exist r:\tmp$$$\*.* d:\virus\im\IM /Pr:\tmp$$$ /VR /NOB /b /RF=nul
  156. echo %color_%
  157. if exist r:\tmp$$$\*.* d:\virus\f-prot r:\tmp$$$\*.* /nomem
  158. pause
  159. if exist r:\tmp$$$\*.* d:\virus\f-prot r:\tmp$$$\*.* /nomem /analyse
  160. pause
  161. if exist r:\tmp$$$\*.* d:\virus\mcafee\scan r:\tmp$$$\*.* /nomem
  162. goto _rmdir
  163.  
  164. rem Remove the temporary directory and its files
  165. :_rmdir
  166. if not exist r:\tmp$$$\*.* goto _chdir
  167. echo y | del r:\tmp$$$\*.* > nul
  168. :_chdir
  169. cd r:\
  170. if exist r:\tmp$$$\nul rmdir r:\tmp$$$
  171. goto _out
  172.  
  173. rem The instructions
  174. :_help
  175. echo Usage: SCANZ [ZipFileName]      (Wildcards are allowed)
  176. echo.
  177. echo You will need the following shareware and PD programs to use this batch.
  178. echo They are available from good BBSes or from garbo.uwasa.fi by anonymous ftp.
  179. echo    PKUNZIP.EXE from pkz204g.exe
  180. echo    SCAN.EXE from scn-22ce.zip
  181. echo    F-PROT.EXE and its auxiliary files from fp-222.zip
  182. echo    TBSCAN.EXE and its auxiliary files from tbav638.zip
  183. echo    IM.EXE and its auxiliary files from i_m261b.zip
  184. echo    DISLITE.EXE from dislt115.zip
  185. echo    UNLZEXE.EXE from unlzexe7.zip
  186. echo    DIET.EXE from diet145f.zip
  187. echo    UNP.EXE from unp411.zip
  188. echo    ASK.EXE from tsbat48.zip
  189. echo Before using this batch you have to edit all the directory paths of this
  190. echo batch to correspond to your own configuration
  191. echo (or adjust your configuration :-).
  192. echo.
  193.  
  194. :_out
  195. set found_=
  196. set color_=
  197. if "%pcid_%"=="dell" echo 
  198.